package cn.wen.yinxiu.works.service;

import cn.wen.yinxiu.works.entity.WorksDataEntity;
import cn.wen.yinxiu.works.vo.ServeHomeInfo;
import cn.wen.yinxiu.works.vo.WorksDataSimpleVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 数据统计服务
 *
 * @ClassName: WorksDataService
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-21 22:19:26
 * @Description: 数据总量统计
 */
public interface WorksDataService extends IService<WorksDataEntity> {

    /**
     * 通过day天数来获取这段时间的增加量和总量
     * @param dayNum
     * @return
     */
     ServeHomeInfo getWorksDataByDay(Long userId, Integer dayNum);

    /**
     * 批量插入数据
     * @param worksDataList
     * @return
     */
    boolean insertBatchWorks(List<WorksDataEntity> worksDataList);

    /**
     * 获取当前时间的存储数据
     *
     * @param currentDayStartTime
     * @return
     */
    List<WorksDataEntity> getWorksDataByTime(String currentDayStartTime);

    /**
     * 获取7天内最远不为空的数据
     * @param preDayTime
     * @return
     */
    List<WorksDataEntity> getWorksDataByNumTime(String preDayTime);

    /**
     * 通过用户ID 获取周期内的数据
     * @param userId
     * @param filed
     * @param perDateTime
     * @param todayEndTime
     * @return
     */
    List<WorksDataSimpleVO> getWorksCoreTendency(Long userId, String filed, String perDateTime, String todayEndTime);

    /**
     * 通过时间获取数据
     *
     * @param time
     * @param userId
     * @return
     */
    WorksDataEntity queryWorksDataByTime(String time, Long userId);
}

